const homeRoutes = [
  {
    path: "introduction",
    name: "Introduction",
    component: () => import("@/views/introduction/introduction.vue"),
    meta: {
      title: "入门测试",
      icon: "Document",
    },
  },
  // {
  //   path: "part1",
  //   name: "part1",
  //   component: () => import("@/views/part/part1.vue"),
  //   meta: {
  //     title: "part1",
  //     icon: "Document",
  //   },
  // },
];
// 扫盘 @/view/part 目录下的所有 .vue 文件,并按这个规则生成路由
const modules = import.meta.glob("@/views/part/*.vue");
for (const path in modules) {
  const name = path.match(/part\/(.*)\.vue/)?.[1];
  if (name) {
    homeRoutes.push({
      path: name,
      name: name,
      component: modules[path] as () => Promise<typeof import("*.vue")>,
      meta: {
        title: name,
        icon: "Document",
      },
    });
  }
}
export { homeRoutes };